﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HKEA.Exporter.Models;
using System.Data;
using System.Data.SqlClient;
using HKEA.Exporter.Utility;
namespace HKEA.Exporter.DAL
{
    public class ActivityTypeDAL
    {
        private const string strSQL = "select id,code,category from t_category where code in('5.1','6.1','6.2','6.3')";
        public List<ActivityType> GetTypeList()
        {
            List<ActivityType> list = new List<ActivityType>();
            
            using(SqlDataReader dr=SQLHelper.ExecuteReader(SQLHelper.ConnectionStringLocalTransaction,CommandType.Text,strSQL,null))
            {
                while(dr.Read())
                {
                    list.Add(new ActivityType(dr.GetInt32(0),dr.GetString(1),dr.GetString(2)));
                }
            }
            return list;
        }
    }
}
